package com.service.khqy;

import java.util.Vector;

import com.bpms.common.CommonUtil;
import com.bpms.common.Dict;
import com.bpms.common.JdbcWorker;
import com.bpms.common.VO;
import com.bpms.common.VOL;
import com.bpms.common.VOList;
import com.bpms.esb.IService;

public class Getavailableaccount implements IService {

	public VO exec(VO vo) {
		VO v = new VO();
		JdbcWorker j=null;
		try{
			j=new JdbcWorker();
			
			String sql="select ACCOUNT from ACCOUNTNO WHERE AVAILABLE='1'";
			VOList volist = j.readAll(new VO(), sql);
			VOL vol = new VOL(volist);
			Vector<VO> vector = vol.listData;
			int i=0;
			String account=vo.getAttr("account");
			for (VO vo2 : vector) {
				String cancelAccount=vo2.getAttr("ACCOUNT");
				if(cancelAccount.equals(account)){
					v.setAttr("result", "1");
					//v.setAttr("msg", "获取已注销的签约帐号成功");
					return v;
				}
			}
			v.setAttr("result", "0000");
			v.setAttr("msg", "获取已注销的签约帐号成功");
			
		}catch (Exception e) {
			CommonUtil.debug("Getcancelaccount exception", e);
			
			v.setAttr("result", "9999");
			v.setAttr("msg", "访问数据库失败");
		}
		
		return v;
	}

}
